:root {
    --map-tiles-filter: brightness(0.6) invert(1) contrast(2) hue-rotate(180deg) saturate(0.6) brightness(0.7);

}

input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type=number] {
    -moz-appearance: textfield;
    appearance: textfield;
    /* Standard property for other browsers */
}

div.latlng {
    display: flex;
    gap: 4px;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f7f7f7;
    opacity: 0.3;
}

body.loaded {
    opacity: 1;
    transition: opacity 1.0s;
}

/* Nav Bar */
.tellus-nav {
    background-color: rgb(255, 255, 255);
    @media (prefers-color-scheme: dark) {
        background-color: rgb(11, 11, 11);
    }
}


.tellus-map-pin-add-buttons {
    z-index: 1000;
    position: absolute;
    display: flex;
    bottom: 50px;
    gap: 10px;
    width: 100%;
}

.tellus-map-confirm-button {
    background-color: rgba(0, 182, 33, 0.657);
    padding: 10px 10px;
    font-size: medium;
    font-weight: bold;
    border-radius: 10px;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    color: white;
    border: 1px solid #00d026;
}

.tellus-map-confirm-button-cancel {
    background-color: rgba(182, 0, 0, 0.657);
    padding: 10px 10px;
    font-size: medium;
    font-weight: bold;
    border-radius: 10px;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    color: white;
    border: 1px solid #d00000;
}

.tellus-map-overlay {
    color: white;
    font-size: 1.3em;
    font-weight: bold;
    display: none;
    position: absolute;
    z-index: 1000;
    top: 20px;
    background: #00000045;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    border-radius: 5px;
    padding: 7px 11px;
    border: 1px #ffffff1f solid;

    p {
        margin: 0px;
        font-size: medium;
        font-weight: bold;
        color: white;
    }
}

.tellus-list-sel {
    padding: 10px;
    background: #0000000f;
    border-radius: 10px;
    color: rgb(0, 0, 0);
    cursor: pointer;

    @media (prefers-color-scheme: dark) {
        background: #ffffff1f;
        color: white;
    }
}

.tellus-list-sel:hover {
    background: #ffffff45;
}

.small-text-p {
    font-size: 0.8em;
    color: gray;
}

#loadingIndicator {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    /* Semi-transparent overlay */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    /* Ensure it's on top of other content */
}

.spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid #fff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}


button.action {
    background-color: #4abd95;
    color: white;
    padding: 7px 15px 6px 15px;
    border-radius: 5px;
    font-size: small;
    font-weight: bold;

    @media (prefers-color-scheme: dark) {
        background-color: darkcyan;
    }
}

.editor-map {
    height: 80vh;
    width: 100%
}

.tellus-territory-label {
    background-color: rgba(0, 0, 0, 0.325);
    border-radius: 10%;
    box-shadow: none;
    font-size: 1.0em;
    font-weight: 900;
    color: white;
    border: none;
    text-align: center;
    line-height: 100%;
}

.contact-edit-screen {
    display: flex;
    flex-direction: row;
    height: calc(100vh - 64px - 20px);
    width: auto;
}

.contact-editor-map {
    height: calc(100vh - 65px);
    position: relative;
    margin: 0px;
    width: 100%;
    z-index: 10;
    justify-items: center;
    padding-left: auto;
    padding-right: auto;
    margin-left: auto;
    margin-right: auto;
}

.map-container {
    width: 100%;
    height: calc(100vh - 64px);
    border: 2px solid #ccc;
    border-radius: 8px;
}

.tellus-button {
    background-color: #4abd95;
    font-weight: bold;
    font-size: 12px;
    cursor: pointer;
    border-radius: 10px;
    white-space: nowrap;
    width: fit-content;

    @media (prefers-color-scheme: dark) {
        background-color: #00000045;
    }

}

.tellus-button:hover {
    background-color: #00000080;
}


.tellus-button-red {
    background-color: #aa121c;
}

img.inline {
    display: inline;
    max-width: 30px;
}

.afterImportConfirm {
    display: none;
    background: #ffffff;
    padding: 5px 10px;
    border-radius: 4px;
}

.territory-name-input-modal {
    display: none;
    background: #ffffffb8;
    padding: 20px;
    z-index: 1000;
    position: relative;
    width: auto;
    height: inherit;
    align-content: center;
    backdrop-filter: blur(5px);
}

.territory-name-input-modal div {
    display: flex;
    flex-flow: column;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
    gap: 10px;
    background-color: white;
    padding: 20px 30px;
    border-radius: 10px;

    h5 {
        font-weight: bold;
        font-size: 1.4em;
    }

    input {
        border: #ccc 1px solid;
        background-color: #ededed;
        border-radius: 5px;
    }

    button {
        border: transparent;
        background-color: #0084ff;
        color: white;
        border-radius: 20px;
        padding: 10px;
        font-weight: 900;
    }

    button.cancel {
        background-color: #919191;
    }
}

.territory-name-delete-modal {
    display: none;
    background: #ffffffb8;
    padding: 20px;
    z-index: 1000;
    position: relative;
    width: auto;
    height: inherit;
    align-content: center;
    backdrop-filter: blur(5px);
}

.territory-name-delete-modal div {
    display: flex;
    flex-flow: column;
    width: fit-content;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
    gap: 10px;
    background-color: white;
    padding: 20px 30px;
    border-radius: 10px;

    h5 {
        font-weight: bold;
        font-size: 1.4em;
    }

    button {
        border: transparent;
        background-color: #cd101c;
        color: white;
        border-radius: 20px;
        padding: 10px;
        font-weight: 900;
    }

    button.cancel {
        background-color: #919191;
    }
}

.contacts-sidebar {
    display: contents;
    flex-direction: column;
}

@media (max-width: 1000px) {
    .contacts-sidebar {
        display: none;
        flex-direction: column;
    }
}

.t-rec-inner {
    background: #ffffff;
    padding: 5px;
    border-radius: 5px;
    margin: 10px 0px;
    display: flex;
    flex-direction: column;
    cursor: pointer;

    small {
        font-size: 12px;
        font-weight: 900;
    }

    p {
        margin-top: 5px;
        font-size: 12px;
    }

    @media (prefers-color-scheme: dark) {
        background-color: #ffffff14;
    }

}

.t-rec-inner:hover {
    background: #624835;
}

.autocomplete-container {
    position: relative;
    width: auto;
    font-family: sans-serif;
}

.tags-input {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    border-radius: 6px;
    cursor: text;
    background-color: antiquewhite;
    color: black;
}

.tag {
    background: #007bff;
    color: white;
    padding: 2px 4px;
    border-radius: 4px;
    margin: 2px;
    display: flex;
    align-items: center;
    font-size: small;
    ;
}

.tag span {
    margin-left: 5px;
    cursor: pointer;
    font-weight: bold;
}

.tags-input input {
    border: none;
    outline: none;
    flex: 1;
    min-width: 100px;
    background: transparent;
}

.autocomplete-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    color: black;
    border: 0px solid #ccc;
    z-index: 10;
    max-height: 150px;
    overflow-y: auto;

    @media (prefers-color-scheme: dark) {
        background-color: #1B2430;
        color: white;
    }
}

.autocomplete-item {
    padding: 5px;
    cursor: pointer;
    font-size: smaller;
}

.autocomplete-item:hover {
    background: #f0f0f04c;
}

.visit-records-section {
    margin-top: 10px;
    margin-bottom: 10px;
    background-color: #00000014;
    padding: 30px 10px;
    margin-left: -16px;
    margin-right: -16px;

    @media (prefers-color-scheme: dark) {
        background-color: #0000003d;
    }

}

.add-new-visit-rec-section {
    background-color: #ffffff;
    margin: 5px 0px;
    padding: 10px 10px;
    gap: 10px;
    display: flex;
    flex-direction: column;
    border-radius: 5px;
    box-shadow: none;

    .anvrs-input {
        background: rgb(227, 227, 227);
        color: black;
        font-weight: 600;
        width: -webkit-fill-available;
        border: transparent;
        border-radius: 5px;
    }

    .anvrs-pulldown {
        background: rgb(227, 227, 227);
        color: black;
        font-weight: 600;
        width: -webkit-fill-available;
        border: transparent;
        border-radius: 5px;
    }

    @media (prefers-color-scheme: dark) {

        background-color: #624835;
        box-shadow: black 0px 2px 8px;

    }
}

#contact-panel {
    z-index: 1000;
    align-content: center;
}

.tellus-panel-close-overlay {
    z-index: -100;
}

.tellus-scrollview {
    max-height: calc(100% - 139px);
    background-color: #e6e6e6;
    margin: 5px;
    padding: 0px;
    overflow: auto;

    /* dark mode */
    @media (prefers-color-scheme: dark) {
        background-color: #263143;
        color: white;
    }

}

.tellus-cell {
    border-bottom: 1px solid #28374e33;
    padding: 10px 15px;
    cursor: pointer;
    gap: 0px;
    display: flex;
    flex-direction: column;
    background-color: #f9f9f9;

    p {
        font-size: 0.9em;
    }

    small {
        font-size: 0.7em;
    }

    @media (prefers-color-scheme: dark) {
        background-color: #151c28;
    }
}

.tellus-cell:hover {
    background-color: #efefef;
}

.tellus-contact-edits {
    margin: 10px 0px;
    min-width: 320px;
    width: 30%;
    background-color: aliceblue;
    height: 100%;
    overflow: auto;
    display: none;

    /* light mode */
    background-color: white;


    /* form */
    .tellus-input {
        border-radius: 7px;
        padding: 7px;
        width: 100%;
        box-sizing: border-box;

        border: transparent;
        color: black;

        @media (prefers-color-scheme: dark) {
            color: white;
        }

        &:read-only {
            background-color: transparent;
            padding-left: 0px;
        }
    }

    .tellus-input.note {

        min-height: 35px;
        max-height: 120px;

        &:read-only {
            height: fit-content;
            padding-left: 0px;
            resize: none;
        }
    }

    .tellus-input.note2 {

        min-height: 35px;
        max-height: 120px;

        &:read-only {
            height: fit-content;
            padding-left: 0px;
            resize: none;
        }
    }

    /* pulldown */
    .tellus-pulldown {
        border-radius: 7px;
        padding: 7px;
        width: 100%;
        box-sizing: border-box;
        margin-bottom: 10px;
        border: transparent;
        color: black;

        @media (prefers-color-scheme: dark) {
            color: white;
        }

        &:read-only {
            background-color: transparent;
            padding-left: 0px;
        }
    }

    /* dark mode */
    @media (prefers-color-scheme: dark) {
        background-color: #1B2430;
        color: white;
    }

}

div.ts-usermanagement {
    margin: 10px 0px;

    /* light mode */
    .tellus-search-input {

        border-radius: 7px;
        padding: 7px;
        width: 100%;
        box-sizing: border-box;
        background-color: #f7f7f728;
        border: transparent;
        color: black;

        @media (prefers-color-scheme: dark) {
            color: white;
        }
    }
}

div.tl-sidebar-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px;
    border-bottom: 1px #ffffff17 solid;

}

button.tl-close-sidebar-btn {
    background-color: transparent;
    cursor: pointer;
    border-radius: 10px;
    padding: 7px 11px 9px 11px;

    img {
        display: inline;
        width: 30px;
    }
}

button.tl-close-sidebar-btn:hover {
    background-color: #00000080;
}


.tooltip {
    position: relative;
    display: inline-block;
    cursor: default;
    z-index: 10001;
}

.tooltip .tooltiptext {
    visibility: hidden;
    padding: 0.25em 0.5em;
    background-color: black;
    color: #fff;
    text-align: center;
    border-radius: 0.25em;
    white-space: nowrap;

    /* Position the tooltip */
    position: absolute;
    z-index: 1000;
    top: 100%;
    transition-property: visibility;
    transition-delay: 0s;

    span {
        z-index: 5000;
    }
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    transition-delay: 0.3s;
}

div.ts-sheet {

    display: flex;
    margin: 15px 0px;

    .ts-inner {
        display: flex;
        margin: 0px 10px;
    }

    .id {
        min-width: 70px;
    }

    .name {
        min-width: 180px;
    }

    .email {
        min-width: 240px;
    }

    .status {
        min-width: 100px;
    }

    .role {
        min-width: 130px;
    }

    .lastlogin {
        min-width: 130px;
    }

    p {
        width: 100%;
    }

    a {
        cursor: pointer;
    }
}

.ts-side-container {
    overflow-x: auto;
}

div.ts-sheet-data {

    display: flex;
    margin: 15px 0px;
    border-radius: 7px;
    flex-direction: column;
    background-color: #ffffff0f;
    width: fit-content;
    min-width: 100%;


    .data-container {
        padding: 10px 0px;
        display: flex;
        width: 100%;
        min-width: max-content;
        cursor: pointer;
        border-bottom: 1px #ffffff17 solid;
    }

    .data-container:hover {
        background-color: #ffffff1f;
    }

    .ts-inner {
        display: flex;
        margin: 0px 10px;
    }

    .id {
        min-width: 70px;
    }

    .name {
        min-width: 180px;
        max-width: 180px;
    }

    .email {
        min-width: 240px;
        max-width: 240px;
    }

    .status {
        min-width: 100px;
    }

    .role {
        min-width: 130px;
    }

    p {
        width: 100%;
    }

    p.role-owner {
        font-size: x-small;
        background-color: red;
        width: fit-content;
        height: fit-content;
        padding: 5px;
        border-radius: 5px;
        font-weight: 900;
    }

    p.role-admin {
        font-size: x-small;
        background-color: blue;
        width: fit-content;
        height: fit-content;
        padding: 5px;
        border-radius: 5px;
        font-weight: 900;
    }

    p.role-member {
        font-size: x-small;
        background-color: gray;
        width: fit-content;
        height: fit-content;
        padding: 5px;
        border-radius: 5px;
        font-weight: 900;
    }

    a {
        cursor: pointer;
    }
}

.ts-text-red {
    color: white;
    background: red;
    padding: 1px 4px;
    font-weight: 900;
    border-radius: 5px;
    margin: 0px 5px;
}

.data-area {
    background-color: #f7f7f728;
    padding: 15px 0px;
    border-radius: 7px;
}

div.add-contact-btn-container {
    z-index: 1000;
    position: absolute;
    right: 12px;
    top: 12px;
    cursor: pointer;
}

div.pw-condition-disp {
    border-radius: 6px;
    background-color: #43412f;
    font-size: small;
    margin-top: 5px;
    color: gray;
    padding: 10px;
}

.contact-edit-pin {
    max-width: 21px;
    padding-left: 0px;
    margin-left: 0px;
    margin-right: 0px;
    padding-right: 0px;
    padding-top: 0px;
}

.tl-pin-edit {
    display: none;
}

@media (max-width: 650px) {
    .tellus-contact-edits {
        /* display: none !important; */
        position: absolute;
        z-index: 15;
        width: 100%;
        height: 70%;
        bottom: 0px;
        margin-left: 0px;
        margin-right: 0px;
        margin-bottom: 0px;
        padding-left: 0px;
        padding-right: 0px;
    }

    .editor-map {
        height: 60vh;
        width: 100%
    }
}

.tellus-contact-edits-sp {
    border-radius: 20px 20px 0px 0px;
    margin: 0px 0px;
    width: 100%;
    background-color: aliceblue;
    height: 50%;
    bottom: 0;
    overflow: auto;
    display: none !important;
    z-index: 1000;

    /* light mode */
    background-color: white;

    /* dark mode */
    @media (prefers-color-scheme: dark) {
        background-color: #1B2430;
        color: white;
    }

}

@media (max-width: 650px) {

}


.contact-drawer {
    /* */
    margin: 0px;
    min-width: 320px;
    width: 30%;
    height: calc(100vh - 65px);
    /* overflow: auto; */
    transition: all .25s ease-in-out;

    input {
        background-color: #f7f7f728;
        width: -webkit-fill-available;
        margin: 5px 5px;
        border-radius: 5px;
        height: 38px;
        font-size: 1.0em;
        border: #00000038 1px solid;
        display: block;
    }

    /* normal */
    background-color: white;

    .tellus-scrollable-contents {
        max-height: calc(100vh - 64px);
    }

    /* dark mode */
    @media (prefers-color-scheme: dark) {
        background-color: #1B2430;
        color: white;
    }

}

.detail-drawer {
    /* */
    border-radius: 20px;
    margin: 10px;
    margin-left: 0px;
    min-width: 320px;
    width: 25%;
    height: calc(100vh - 64px - 20px);
    overflow: auto;
    transition: all .25s ease-in-out;
    background-color: violet;
}

@media (prefers-color-scheme: dark) {
    .map-tiles {
        filter: var(--map-tiles-filter, none);
    }
}